package com.nbsaas.boot.order.rest.resource;

import com.nbsaas.boot.order.api.apis.OrderLogApi;
import com.nbsaas.boot.order.data.entity.OrderLog;
import com.nbsaas.boot.order.api.domain.request.OrderLogRequest;
import com.nbsaas.boot.order.api.domain.response.OrderLogResponse;
import com.nbsaas.boot.order.api.domain.simple.OrderLogSimple;
import com.nbsaas.boot.order.rest.convert.OrderLogSimpleConvert;
import com.nbsaas.boot.order.rest.convert.OrderLogEntityConvert;
import com.nbsaas.boot.order.rest.convert.OrderLogResponseConvert;
import com.nbsaas.boot.order.data.repository.OrderLogRepository;

import java.io.Serializable;
import com.nbsaas.boot.jpa.data.core.BaseResource;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import org.springframework.data.jpa.repository.support.JpaRepositoryImplementation;

import java.util.function.Function;
/**
*   业务接口实现
*/
@Transactional
@Service
public class OrderLogResource extends BaseResource<OrderLog,OrderLogResponse, OrderLogSimple, OrderLogRequest>  implements OrderLogApi {

    @Resource
    private OrderLogRepository orderLogRepository;

    @Override
    public JpaRepositoryImplementation<OrderLog, Serializable> getJpaRepository() {
        return orderLogRepository;
    }

    @Override
    public Function<OrderLog, OrderLogSimple> getConvertSimple() {
        return new OrderLogSimpleConvert();
    }

    @Override
    public Function<OrderLogRequest, OrderLog> getConvertForm() {
        return new OrderLogEntityConvert();
    }

    @Override
    public Function<OrderLog, OrderLogResponse> getConvertResponse() {
        return new OrderLogResponseConvert();
    }




}


